package cn.com.darly.videoandroidpm.common;

import com.darly.common.DLog;

import java.util.HashMap;
import java.util.Map;
import java.util.Timer;

/**
 * 计时器功能
 * @author Darly/张宇辉/2018/5/29 10:49
 * @version 1.0/cn.com.darly.videoandroidpm.common
 */
public class VpmTimer {
    public static Map<String ,Timer> Timers= new HashMap<String ,Timer>();

    private static VpmTimer instance;

    private VpmTimer() {
    }

    public static VpmTimer getInstance() {
        if (instance == null){
            instance = new VpmTimer();
        }
        return instance;
    }

    public void stopTimer (String key){
        Timer timer = Timers.get(key);
        if (timer!=null){
            timer.cancel();
            Timers.remove(key);
        }
        DLog.i(Timers.size());
    }
}
